home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 42 / Amiga Format AFCD42 (Issue 126, Aug 1999).iso / -serious- / archivers / headbanger / archbanger next >
AmigaDOS Script File  |  1999-05-25  |  1KB  |  50 lines

  1. .key com/a,infile/a,outfile
  2. .bra {
  3. .ket }
  4.  
  5. ; $VER: Archbanger v0.1
  6. ; archiver script with headbanger
  7. ; parameters are:
  8. ;   com/a    - command (c-comress, d-decompress), required
  9. ;   infile/a - input file- (or directory-) name, required
  10. ;   outfile  - output filename, not required, derived then from infile
  11.  
  12. FailAt 21
  13.  
  14. IF "{com}" EQ "c"
  15.  
  16. Echo "Compressing {infile}..."
  17. delete >NIL: {infile}.tmp
  18. lha a -r -z {infile}.tmp {infile}
  19.   IF EXISTS {infile}.tmp
  20.     IF "" EQ "{outfile}"
  21.        headbanger c {infile}.tmp maxnibble 1048576
  22.        delete >NIL: {infile}.hdbg
  23.        rename {infile}.tmp.hdbg {infile}.hdbg
  24.        delete >NIL: {infile}.tmp
  25.  
  26.     ELSE
  27.        headbanger c {infile).tmp {outfile}
  28.        delete >NIL: {infile}.tmp
  29.     ENDIF
  30.   ELSE
  31.     Echo "Cannot find {infile}"
  32.   ENDIF
  33.  
  34. ELSE
  35.  
  36.   IF "{com}" EQ "d"
  37.  
  38.     Echo "Decompressing {infile}..."
  39.     headbanger d {infile} {infile}.tmp
  40.     IF EXISTS {infile}.tmp
  41.       lha x {infile}.tmp
  42.       delete >NIL: {infile}.tmp
  43.     ENDIF
  44.  
  45.   ELSE
  46.     Echo "Wrong command!"
  47.   ENDIF
  48.  
  49. ENDIF
  50.